<?php
// +----------------------------------------------------------------------
// | Author: 发仔 <i@fazi.me> 
// +----------------------------------------------------------------------

namespace app\admin\controller;

use think\Controller;
use think\Db;

class Refuel extends Base
{
    protected $id = 'refuel_record_id';
	protected $table = 'refuel_record';
	protected $join = ['driver d','d.driver_id = m.driver_id','left'];
	protected $field = 'm.*,d.name';
	
	protected function search() {
		
		$P = input('param.');
		$where = [];
		
		$P['number'] && $where['car_number'] = ['LIKE',"%{$P['number']}%"];
		$P['start_date'] && $where['start_date'] = ['>=',$P['start_date']];
		
		return $where;
	}
	
	
	protected function options($item = []) {
		
		$labels = config('base.labels');
		$this->assign('labels',TplOptions($labels,$item['label']));
		
		return $item;
		
	}
}
